package edu.bath.sensorframework.triplestore.server;

import edu.bath.sensorframework.triplestore.agent.TripleStoreAgent;
import edu.bath.sensorframework.triplestore.client.TripeStoreAgentService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class TripeStoreAgentServiceImpl extends RemoteServiceServlet implements TripeStoreAgentService {
	private static final long serialVersionUID = -6149892425745641745L;

	@Override
	public String getAgraphUsername() {
		return TripleStoreAgent.getAgraphUsername();
	}

	@Override
	public String getAgraphServerURL() {
		return TripleStoreAgent.getAgraphServerURL();
	}

	@Override
	public boolean hasAgraphPassword() {
		return TripleStoreAgent.hasAgraphPassword();
	}

	@Override
	public String getAgraphCatID() {
		return TripleStoreAgent.getAgraphCatID();
	}

	@Override
	public String getAgraphRepoID() {
		return TripleStoreAgent.getAgraphRepoID();
	}

	@Override
	public void setAgraphPassword(String password) {
		TripleStoreAgent.setAgraphPassword(password);
	}

	@Override
	public void setAgraphRepoID(String repoID) {
		TripleStoreAgent.setAgraphRepoID(repoID);
	}

	@Override
	public void setAgraphCatID(String catID) {
		TripleStoreAgent.setAgraphCatID(catID);
	}

	@Override
	public void setAgraphUsername(String username) {
		TripleStoreAgent.setAgraphUsername(username);
	}

	@Override
	public void setAgraphServerURL(String serverURL) {
		TripleStoreAgent.setAgraphServerURL(serverURL);
	}

	@Override
	public void updateSettings(String serverURL, String username,
			String password, String catID, String repoID) {
		setAgraphPassword(password);
		updateSettings(serverURL, username, catID, repoID);
	}

	@Override
	public void updateSettings(String serverURL, String username, String catID,
			String repoID) {
		setAgraphCatID(catID);
		setAgraphRepoID(repoID);
		setAgraphServerURL(serverURL);
		setAgraphUsername(username);
	}

	@Override
	public void addDataSource(String handle) throws RuntimeException {
		TripleStoreAgent.addDataSource(handle);
	}
}
